//
//  AchievementDetailCell.m
//  NewPro
//
//  Created by 何荧红 on 2019/1/8.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "AchievementDetailCell.h"

@interface AchievementDetailCell ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *fristHeight;
@property (weak, nonatomic) IBOutlet UILabel *FFristCount;
@property (weak, nonatomic) IBOutlet UILabel *FFristTitle;
@property (weak, nonatomic) IBOutlet UILabel *FSecCount;
@property (weak, nonatomic) IBOutlet UILabel *FSecTitle;

@property (weak, nonatomic) IBOutlet UIImageView *FristImg;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFristFHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFristFCountHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFristSHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFristSCountHeight;

@property (weak, nonatomic) IBOutlet UILabel *IsFristFFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFristFSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFristFFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFristFSTitle;

@property (weak, nonatomic) IBOutlet UILabel *ISFristSFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFristSSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFristSFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFristSSTitle;

//第二个
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *SecHeight;
@property (weak, nonatomic) IBOutlet UILabel *SFristCount;
@property (weak, nonatomic) IBOutlet UILabel *SFristTitle;
@property (weak, nonatomic) IBOutlet UILabel *SSecCount;
@property (weak, nonatomic) IBOutlet UILabel *SSecTitle;

@property (weak, nonatomic) IBOutlet UIImageView *SecImg;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISSecFHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISSecFCountHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISSecSHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISSecSCountHeight;

@property (weak, nonatomic) IBOutlet UILabel *ISSecFFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISSecFSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISSecFFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISSecFSTitle;

@property (weak, nonatomic) IBOutlet UILabel *ISSecSFcount;
@property (weak, nonatomic) IBOutlet UILabel *ISSecSSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISSecSFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISSecSSTitle;
//第三
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ThirdHeight;
@property (weak, nonatomic) IBOutlet UILabel *TFristCount;
@property (weak, nonatomic) IBOutlet UILabel *TFristTitle;
@property (weak, nonatomic) IBOutlet UILabel *TSecCount;
@property (weak, nonatomic) IBOutlet UILabel *TSecTitle;

@property (weak, nonatomic) IBOutlet UIImageView *ThirdImg;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISThirdFFHeight;//
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISThirdFCountHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISThirdSFHeight;//
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISThirdSCountHeight;

@property (weak, nonatomic) IBOutlet UILabel *ISThirdFFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdFFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdFSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdFSTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdFTCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdFTTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdFFoCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdFFoTitle;

@property (weak, nonatomic) IBOutlet UILabel *ISThirdSFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdSFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdSSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdSSTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdSTCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdStTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdSFoCount;
@property (weak, nonatomic) IBOutlet UILabel *ISThirdSFoTitle;
//第四
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *FourthHeight;
@property (weak, nonatomic) IBOutlet UILabel *FourthFristCount;
@property (weak, nonatomic) IBOutlet UILabel *FourthFristTitle;
@property (weak, nonatomic) IBOutlet UILabel *FourthSecCount;
@property (weak, nonatomic) IBOutlet UILabel *FourthSecTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthHCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthHTitle;

@property (weak, nonatomic) IBOutlet UIImageView *FourthImg;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFourthFFHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFourthFCountHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFourthSFHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFourthSCountHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFourthTHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ISFourthTCountHeight;

@property (weak, nonatomic) IBOutlet UILabel *ISFourthFFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthFFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthFSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthFSTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthFTCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthFTTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthFFoCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthFFoTitle;

@property (weak, nonatomic) IBOutlet UILabel *ISFourthSFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthSFTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthSSCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthSSTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthSTCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthStTitle;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthSFoCount;
@property (weak, nonatomic) IBOutlet UILabel *ISFourthSFoTitle;


@property (weak, nonatomic) IBOutlet UILabel *ISfourthTFCount;
@property (weak, nonatomic) IBOutlet UILabel *ISfourthTFTitle;

@end


@implementation AchievementDetailCell

- (void)setModel:(AchievementDetailModel *)model{
    _model = model;
    self.FFristTitle.text = [_model.Partners[@"expandPartners"][@"total"] stringValue];
    self.ISFristFFTitle.text = [_model.Partners[@"expandPartners"][@"realName"] stringValue];
    self.ISFristFSTitle.text = [_model.Partners[@"expandPartners"][@"unRealName"] stringValue];
    self.FSecTitle.text = [_model.Partners[@"promotionPartners"][@"total"] stringValue];
    self.ISFristSFTitle.text = [_model.Partners[@"promotionPartners"][@"realName"] stringValue];
    self.ISFristSSTitle.text = [_model.Partners[@"promotionPartners"][@"unRealName"] stringValue];
    
    self.SFristTitle.text = [_model.Merchants[@"expandMerchants"][@"total"] stringValue];
    self.ISSecFFTitle.text = [_model.Merchants[@"expandMerchants"][@"realName"] stringValue];
    self.ISSecFSTitle.text = [_model.Merchants[@"expandMerchants"][@"unRealName"] stringValue];
    self.SSecTitle.text = [_model.Merchants[@"promotionMerchants"][@"total"] stringValue];
    self.ISSecSFTitle.text = [_model.Merchants[@"promotionMerchants"][@"realName"] stringValue];
    self.ISSecSSTitle.text = [_model.Merchants[@"promotionMerchants"][@"unRealName"] stringValue];
    
    self.TFristTitle.text = _model.totalAmount[@"expandAmount"][@"total"];
    self.ISThirdFFTitle.text = _model.totalAmount[@"expandAmount"][@"pos"];
    self.ISThirdFSTitle.text = _model.totalAmount[@"expandAmount"][@"epos"];
    self.ISThirdFTTitle.text = _model.totalAmount[@"expandAmount"][@"qrcode"];
    self.ISThirdFFoTitle.text = _model.totalAmount[@"expandAmount"][@"cloudPay"];
    self.TSecTitle.text = _model.totalAmount[@"promotionAmount"][@"total"];
    self.ISThirdSFTitle.text = _model.totalAmount[@"promotionAmount"][@"pos"];
    self.ISThirdSSTitle.text = _model.totalAmount[@"promotionAmount"][@"epos"];
    self.ISThirdStTitle.text = _model.totalAmount[@"promotionAmount"][@"qrcode"];
    self.ISThirdSFoTitle.text = _model.totalAmount[@"promotionAmount"][@"cloudPay"];
    
    self.FourthFristTitle.text = _model.income[@"expandIncome"][@"total"];
    self.ISFourthFFTitle.text = _model.income[@"expandIncome"][@"pos"];
    self.ISFourthFSTitle.text = _model.income[@"expandIncome"][@"epos"];
    self.ISFourthFTTitle.text = _model.income[@"expandIncome"][@"qrcode"];
    self.ISFourthFFoTitle.text = _model.income[@"expandIncome"][@"cloudPay"];
    self.FourthSecTitle.text = _model.income[@"promotionIncome"][@"total"];
    self.ISFourthSFTitle.text = _model.income[@"promotionIncome"][@"pos"];
    self.ISFourthSSTitle.text = _model.income[@"promotionIncome"][@"epos"];
    self.ISFourthStTitle.text = _model.income[@"promotionIncome"][@"qrcode"];
    self.ISFourthSFoTitle.text = _model.income[@"promotionIncome"][@"cloudPay"];
    self.ISFourthHTitle.text = _model.income[@"actIncome"][@"actIncome"];
    self.ISfourthTFTitle.text = _model.income[@"actIncome"][@"actIncome"];
    
    self.isFrist = _model.isFrist;
    self.isSec = _model.isSec;
    self.isThird = _model.isThird;
    self.isFourth = _model.isFourth;
}

- (void)setIsFrist:(BOOL)isFrist{
    _isFrist = isFrist;
    if (_isFrist) {
        self.FristImg.image = [UIImage imageNamed:@"灰色上箭头"];
        self.fristHeight.constant = 181;
        self.ISFristFCountHeight.constant = 9;
        self.FFristCount.textColor = [UIColor colorWithHexString:@"0CA6F0"];
        self.ISFristFHeight.constant = 90;
        self.ISFristSCountHeight.constant = 9;
        self.FSecCount.textColor = [UIColor colorWithHexString:@"0CA6F0"];
        self.ISFristSHeight.constant = 90;
        
        self.IsFristFFCount.hidden = NO;
        self.ISFristFSCount.hidden = NO;
        self.ISFristFFTitle.hidden = NO;
        self.ISFristFSTitle.hidden = NO;
        self.ISFristSFCount.hidden = NO;
        self.ISFristSSCount.hidden = NO;
        self.ISFristSFTitle.hidden = NO;
        self.ISFristSSTitle.hidden = NO;
        
    }else{
        self.FristImg.image = [UIImage imageNamed:@"灰色下箭头"];
        self.fristHeight.constant = 91;
        self.ISFristFHeight.constant = 45;
        self.ISFristFCountHeight.constant = 17;
        self.FFristCount.textColor = [UIColor colorWithHexString:@"666666"];
        self.ISFristSHeight.constant = 45;
        self.ISFristSCountHeight.constant = 17;
        self.FSecCount.textColor = [UIColor colorWithHexString:@"666666"];
        
        self.IsFristFFCount.hidden = YES;
        self.ISFristFSCount.hidden = YES;
        self.ISFristFFTitle.hidden = YES;
        self.ISFristFSTitle.hidden = YES;
        self.ISFristSFCount.hidden = YES;
        self.ISFristSSCount.hidden = YES;
        self.ISFristSFTitle.hidden = YES;
        self.ISFristSSTitle.hidden = YES;
    }
}
- (void)setIsSec:(BOOL)isSec{
    _isSec = isSec;
    if (_isSec) {
        self.SecImg.image = [UIImage imageNamed:@"灰色上箭头"];
        self.SecHeight.constant = 181;
        self.ISSecFHeight.constant = 90;
        self.ISSecFCountHeight.constant = 9;
        self.SFristCount.textColor = [UIColor colorWithHexString:@"0CA6F0"];
        self.ISSecSHeight.constant = 90;
        self.ISSecSCountHeight.constant = 9;
        self.SSecCount.textColor = [UIColor colorWithHexString:@"0CA6F0"];
        
        self.ISSecFFCount.hidden = NO;
        self.ISSecFSCount.hidden = NO;
        self.ISSecFFTitle.hidden = NO;
        self.ISSecFSTitle.hidden = NO;
        self.ISSecSFcount.hidden = NO;
        self.ISSecSSCount.hidden = NO;
        self.ISSecSFTitle.hidden = NO;
        self.ISSecSSTitle.hidden = NO;
        
    }else{
        self.SecImg.image = [UIImage imageNamed:@"灰色下箭头"];
        self.SecHeight.constant = 91;
        self.ISSecFHeight.constant = 45;
        self.ISSecFCountHeight.constant = 17;
        self.SFristCount.textColor = [UIColor colorWithHexString:@"666666"];
        self.ISSecSHeight.constant = 45;
        self.ISSecSCountHeight.constant = 17;
        self.SSecCount.textColor = [UIColor colorWithHexString:@"666666"];
        
        self.ISSecFFCount.hidden = YES;
        self.ISSecFSCount.hidden = YES;
        self.ISSecFFTitle.hidden = YES;
        self.ISSecFSTitle.hidden = YES;
        self.ISSecSFcount.hidden = YES;
        self.ISSecSSCount.hidden = YES;
        self.ISSecSFTitle.hidden = YES;
        self.ISSecSSTitle.hidden = YES;
    }
}
- (void)setIsThird:(BOOL)isThird{
    _isThird = isThird;
    if (_isThird) {
        self.ThirdImg.image = [UIImage imageNamed:@"灰色上箭头"];
        self.ThirdHeight.constant = 303;
        self.ISThirdFFHeight.constant = 151;
        self.ISThirdFCountHeight.constant = 9;
        self.TFristCount.textColor = [UIColor colorWithHexString:@"F52626"];
        self.ISThirdSFHeight.constant = 151;
        self.ISThirdSCountHeight.constant = 9;
        self.TSecCount.textColor = [UIColor colorWithHexString:@"F52626"];
        
        self.ISThirdFFCount.hidden = NO;
        self.ISThirdFFTitle.hidden = NO;
        self.ISThirdFSCount.hidden = NO;
        self.ISThirdFSTitle.hidden = NO;
        self.ISThirdFTCount.hidden = NO;
        self.ISThirdFTTitle.hidden = NO;
        self.ISThirdFFoCount.hidden = NO;
        self.ISThirdFFoTitle.hidden = NO;
        
        self.ISThirdSFCount.hidden = NO;
        self.ISThirdSFTitle.hidden = NO;
        self.ISThirdSSCount.hidden = NO;
        self.ISThirdSSTitle.hidden = NO;
        self.ISThirdSTCount.hidden = NO;
        self.ISThirdStTitle.hidden = NO;
        self.ISThirdSFoCount.hidden = NO;
        self.ISThirdSFoTitle.hidden = NO;
    }else{
        self.ThirdImg.image = [UIImage imageNamed:@"灰色下箭头"];
        self.ThirdHeight.constant = 91;
        self.ISThirdFFHeight.constant = 45;
        self.ISThirdFCountHeight.constant = 17;
        self.TFristCount.textColor = [UIColor colorWithHexString:@"666666"];
        self.ISThirdSFHeight.constant = 45;
        self.ISThirdSCountHeight.constant = 17;
        self.TSecCount.textColor = [UIColor colorWithHexString:@"666666"];
        
        self.ISThirdFFCount.hidden = YES;
        self.ISThirdFFTitle.hidden = YES;
        self.ISThirdFSCount.hidden = YES;
        self.ISThirdFSTitle.hidden = YES;
        self.ISThirdFTCount.hidden = YES;
        self.ISThirdFTTitle.hidden = YES;
        self.ISThirdFFoCount.hidden = YES;
        self.ISThirdFFoTitle.hidden = YES;
        
        self.ISThirdSFCount.hidden = YES;
        self.ISThirdSFTitle.hidden = YES;
        self.ISThirdSSCount.hidden = YES;
        self.ISThirdSSTitle.hidden = YES;
        self.ISThirdSTCount.hidden = YES;
        self.ISThirdStTitle.hidden = YES;
        self.ISThirdSFoCount.hidden = YES;
        self.ISThirdSFoTitle.hidden = YES;
    }
}
- (void)setIsFourth:(BOOL)isFourth{
    _isFourth = isFourth;
    if (_isFourth) {
        self.FourthImg.image = [UIImage imageNamed:@"灰色上箭头"];
        self.FourthHeight.constant = 363;
        self.ISFourthFFHeight.constant = 151;
        self.ISFourthFCountHeight.constant = 9;
        self.FourthFristCount.textColor = [UIColor colorWithHexString:@"F52626"];
        self.ISFourthSFHeight.constant = 151;
        self.ISFourthSCountHeight.constant = 9;
        self.FourthSecCount.textColor = [UIColor colorWithHexString:@"F52626"];
        self.ISFourthTHeight.constant = 59;
        self.ISFourthTCountHeight.constant = 9;
        self.ISFourthHCount.textColor = [UIColor colorWithHexString:@"F52626"];
        
        self.ISFourthFFCount.hidden = NO;
        self.ISFourthFFTitle.hidden = NO;
        self.ISFourthFSCount.hidden = NO;
        self.ISFourthFSTitle.hidden = NO;
        self.ISFourthFTCount.hidden = NO;
        self.ISFourthFTTitle.hidden = NO;
        self.ISFourthFFoCount.hidden = NO;
        self.ISFourthFFoTitle.hidden = NO;
        
        self.ISFourthSFCount.hidden = NO;
        self.ISFourthSFTitle.hidden = NO;
        self.ISFourthSSCount.hidden = NO;
        self.ISFourthSSTitle.hidden = NO;
        self.ISFourthSTCount.hidden = NO;
        self.ISFourthStTitle.hidden = NO;
        self.ISFourthSFoCount.hidden = NO;
        self.ISFourthSFoTitle.hidden = NO;
        
        self.ISfourthTFCount.hidden = NO;
        self.ISfourthTFTitle.hidden = NO;
    }else{
        self.FourthImg.image = [UIImage imageNamed:@"灰色下箭头"];
        self.FourthHeight.constant = 137;
        self.ISFourthFFHeight.constant = 45;
        self.ISFourthFCountHeight.constant = 17;
        self.FourthFristCount.textColor = [UIColor colorWithHexString:@"666666"];
        self.ISFourthSFHeight.constant = 45;
        self.ISFourthSCountHeight.constant = 17;
        self.FourthSecCount.textColor = [UIColor colorWithHexString:@"666666"];
        self.ISFourthTHeight.constant = 45;
        self.ISFourthTCountHeight.constant = 17;
        self.ISFourthHCount.textColor = [UIColor colorWithHexString:@"666666"];
        
        self.ISFourthFFCount.hidden = YES;
        self.ISFourthFFTitle.hidden = YES;
        self.ISFourthFSCount.hidden = YES;
        self.ISFourthFSTitle.hidden = YES;
        self.ISFourthFTCount.hidden = YES;
        self.ISFourthFTTitle.hidden = YES;
        self.ISFourthFFoCount.hidden = YES;
        self.ISFourthFFoTitle.hidden = YES;
        
        self.ISFourthSFCount.hidden = YES;
        self.ISFourthSFTitle.hidden = YES;
        self.ISFourthSSCount.hidden = YES;
        self.ISFourthSSTitle.hidden = YES;
        self.ISFourthSTCount.hidden = YES;
        self.ISFourthStTitle.hidden = YES;
        self.ISFourthSFoCount.hidden = YES;
        self.ISFourthSFoTitle.hidden = YES;
        
        self.ISfourthTFCount.hidden = YES;
        self.ISfourthTFTitle.hidden = YES;
    }
}


- (void)awakeFromNib {
    [super awakeFromNib];
}
- (IBAction)ClikIsFrist:(UIButton *)sender {
    self.isFrist = !self.isFrist;
    if (self.SendIsFristBlock) self.SendIsFristBlock(self.isFrist);
}
- (IBAction)ClikIsSec:(UIButton *)sender {
    self.isSec = !self.isSec;
    if (self.SendIsSecBlock) self.SendIsSecBlock(self.isSec);
}
- (IBAction)ClikIsThr:(UIButton *)sender {
    self.isThird = !self.isThird;
    if (self.SendIsThirdBlock) self.SendIsThirdBlock(self.isThird);
}
- (IBAction)ClikIsFor:(UIButton *)sender {
    self.isFourth = !self.isFourth;
    if (self.SendIsFourthBlock) self.SendIsFourthBlock(self.isFourth);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
